package com.l.web.service.system.config;

import org.l.qiao.Cluster;
import org.l.qiao.connect.MongoDB;
import org.l.qiao.CollectionDAO;
import org.l.qiao.search.Query;

public class ConfigDAO extends CollectionDAO {

    public static final String COLLECTION = "c_config";

    public ConfigDAO(MongoDB nosql) {
        super(nosql, COLLECTION);
    }

    public Config getConfig(String key) {
        Query query = new Query(Config.KEY, key);
        Cluster cluster = findOne(query);
        return new Config(cluster);
    }
}
